((typeof self !== 'undefined' ? self : this)["webpackJsonpproduct_manager"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpproduct_manager"] || []).push([[24],{

/***/ "9dac":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
var toConsumableArray = __webpack_require__("2909");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
var es_number_constructor = __webpack_require__("a9e3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.ends-with.js
var es_string_ends_with = __webpack_require__("8a79");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
var es_function_name = __webpack_require__("b0c0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
var es_array_concat = __webpack_require__("99af");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
var es_array_map = __webpack_require__("d81d");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
var es_array_iterator = __webpack_require__("e260");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
var es_object_to_string = __webpack_require__("d3b7");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
var es_string_iterator = __webpack_require__("3ca3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
var web_dom_collections_iterator = __webpack_require__("ddb0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
var web_url = __webpack_require__("2b3d");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
var es_array_splice = __webpack_require__("a434");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
var es_regexp_exec = __webpack_require__("ac1f");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
var es_string_split = __webpack_require__("1276");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
var es_array_join = __webpack_require__("a15b");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
var es_array_slice = __webpack_require__("fb6a");

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/upload.vue?vue&type=script&lang=js&
















/* harmony default export */ var uploadvue_type_script_lang_js_ = ({
  props: {
    acceptSuffix: {
      type: Array,
      default: function _default() {
        return ['.png', '.jpg', '.jpeg', '.gif', '.webp'];
      }
    },
    preview: {
      type: Boolean,
      default: true
    },
    limit: {
      type: Number,
      default: 1
    }
  },
  data: function data() {
    return {
      src: [],
      files: []
    };
  },
  methods: {
    triggerUpload: function triggerUpload() {
      var btn = this.$refs.upBtn;
      btn.click();
    },
    reset: function reset(e) {
      e.target.value = '';
    },
    upChange: function upChange(e) {
      this.checkStatus(e.target.files);
    },
    checkStatus: function checkStatus(files) {
      var _this = this;

      if (files.length === 0) return;

      if (files.length + this.files.length > this.$props.limit) {
        this.showNotify({
          message: "\u6700\u591A\u9009\u62E9".concat(this.$props.limit, "\u4E2A\u6587\u4EF6"),
          type: 'warning',
          position: 'top',
          timeout: 2000
        });
        return;
      }

      var status = true;

      try {
        Array.prototype.forEach.call(files, function (val) {
          if (_this.acceptSuffix.length > 0 && _this.$props.acceptSuffix.every(function (v) {
            return !val.name.toLowerCase().endsWith(v);
          })) {
            _this.showNotify({
              message: '格式不支持，请重新选择',
              type: 'warning',
              position: 'top',
              timeout: 3000
            });

            status = false;
            throw new Error();
          }
        });
      } catch (e) {}

      if (status) {
        this.files = [].concat(Object(toConsumableArray["a" /* default */])(this.files), Object(toConsumableArray["a" /* default */])(files));

        if (this.$props.preview) {
          this.src = Array.prototype.map.call(this.files, function (val) {
            return window.URL.createObjectURL(val);
          });
        }

        this.upload(this.files);
        this.files = [];
      }
    },
    upload: function upload(files) {
      this.$emit('upload', files);
    },
    del: function del(i) {
      this.src.splice(i, 1);
      this.files.splice(i, 1);
      this.$emit('del', this.files);
    }
  },
  beforeDestroy: function beforeDestroy() {
    this.files = [];
    this.src.map(function (v) {
      window.URL.revokeObjectURL(v);
    });
    this.src = [];
  },
  render: function render() {
    var _this2 = this;

    var h = arguments[0];
    return h("div", {
      "class": this.$slots.default ? '' : 'upload',
      "on": {
        "click": this.$slots.default ? this.triggerUpload : function () {}
      }
    }, [this.$scopedSlots.default ? this.$scopedSlots.default() : this.$props.preview ? h("div", {
      "class": "container-preview"
    }, [this.src.map(function (v, i) {
      return h("div", {
        "class": "item",
        "key": v
      }, [h("el-image", {
        "class": "img",
        "attrs": {
          "src": v,
          "fit": "contain",
          "preview-src-list": _this2.src
        },
        "scopedSlots": {
          error: function error(props) {
            return '';
          }
        }
      }), h("span", {
        "class": "close",
        "on": {
          "click": _this2.del.bind(_this2, i)
        }
      }, ["\xD7"])]);
    }), h("div", {
      "class": "add item"
    }, [h("span", {
      "on": {
        "click": this.triggerUpload
      }
    }, ["+"])])]) : h("div", {
      "class": "container-notpreview"
    }, [h("el-button", {
      "attrs": {
        "type": "primary",
        "size": "mini"
      },
      "on": {
        "click": this.triggerUpload
      }
    }, ["\u70B9\u51FB\u9009\u62E9\u6587\u4EF6"]), h("div", {
      "class": "files-list"
    }, [Array.prototype.map.call(this.files, function (file, i) {
      var nameArr = file.name.split('.');
      var suffix = '.' + nameArr.at(-1);
      var name = nameArr.slice(0, -1).join('');
      return h("div", {
        "class": "item"
      }, [h("div", {
        "class": "name"
      }, [h("span", {
        "attrs": {
          "title": name + suffix
        }
      }, [name]), h("span", {
        "attrs": {
          "title": name + suffix
        }
      }, [suffix])]), h("span", {
        "class": "close",
        "on": {
          "click": _this2.del.bind(_this2, i)
        }
      }, ["\xD7"])]);
    })])]), h("input", {
      "attrs": {
        "type": "file",
        "accept": this.$props.acceptSuffix.join(','),
        "multiple": "multiple"
      },
      "style": "display: none",
      "on": {
        "click": this.reset,
        "change": this.upChange
      },
      "ref": "upBtn"
    })]);
  }
});
// CONCATENATED MODULE: ./src/components/upload.vue?vue&type=script&lang=js&
 /* harmony default export */ var components_uploadvue_type_script_lang_js_ = (uploadvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./src/components/upload.vue?vue&type=style&index=0&id=097ec4c6&lang=stylus&scoped=true&
var uploadvue_type_style_index_0_id_097ec4c6_lang_stylus_scoped_true_ = __webpack_require__("f474");

// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/components/upload.vue
var render, staticRenderFns





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_uploadvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  "097ec4c6",
  null
  
)

/* harmony default export */ var upload = __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ "c96f":
/***/ (function(module, exports, __webpack_require__) {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb");
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, ".upload .container-preview[data-v-097ec4c6]{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.upload .container-preview .item[data-v-097ec4c6]{width:80px;height:80px;padding:5px;position:relative}.upload .container-preview .item .close[data-v-097ec4c6]{position:absolute;top:5px;right:5px;font-size:18px;cursor:pointer;line-height:1}.upload .container-preview .item>.img[data-v-097ec4c6]{width:100%;height:100%}.upload .container-preview .add[data-v-097ec4c6]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.upload .container-preview .add>span[data-v-097ec4c6]{cursor:pointer;font-size:56px;color:grey}.upload .container-notpreview .files-list[data-v-097ec4c6]{max-width:300px}.upload .container-notpreview .files-list .item[data-v-097ec4c6]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.upload .container-notpreview .files-list .item+.item[data-v-097ec4c6]{margin-top:2px}.upload .container-notpreview .files-list .item .name[data-v-097ec4c6]{min-width:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.upload .container-notpreview .files-list .item .name>span[data-v-097ec4c6]:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upload .container-notpreview .files-list .item .name>span[data-v-097ec4c6]:last-child{-ms-flex-negative:0;flex-shrink:0}.upload .container-notpreview .files-list .item .close[data-v-097ec4c6]{font-size:18px;cursor:pointer;margin-left:8px}", ""]);
// Exports
module.exports = exports;


/***/ }),

/***/ "d044":
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__("c96f");
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("499e").default
var update = add("4aa81d89", content, true, {"sourceMap":false,"shadowMode":false});

/***/ }),

/***/ "f474":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_11_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_3_node_modules_stylus_loader_index_js_ref_11_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_upload_vue_vue_type_style_index_0_id_097ec4c6_lang_stylus_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("d044");
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_11_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_3_node_modules_stylus_loader_index_js_ref_11_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_upload_vue_vue_type_style_index_0_id_097ec4c6_lang_stylus_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_11_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_3_node_modules_stylus_loader_index_js_ref_11_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_upload_vue_vue_type_style_index_0_id_097ec4c6_lang_stylus_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */


/***/ })

}]);